#ifndef GLUTENGINE_H
#define GLUTENGINE_H

#include "WindowEngine.hpp"
#include "graphicEngine.h"
#include "../Model/AppList.h"

/* define the function called while glutDisplay callback */
enum DrawState{
  ROTATING_RIGHT,
  ROTATING_LEFT,
  IN_APP
};

class GlutEngine : public WindowEngine {
public:
  static void init(GraphicEngine* ge, AppList* list, int* argc, char ** argv);

  /**
   * refresh screen
   */
  static void refresh(void);

  /**
   * open the window and start the engine
   */
  static void start(void);

  /**
   * get the current time
   */
  static int getTime(void);

  /**
   * Draw text
   */
  static void drawText(std::string text);

  /* GLUT Callbacks */
  static void glutDraw(void);
  static void glutIdle(void);
  static void glutKeyboard(unsigned char key, int x, int y);

  static AppList* _list;
  static GraphicEngine* local_ge;
  static WindowEngine::DrawState state;
  static bool mask;
};

#endif
